﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="ucCRAttachment.ascx.cs" Inherits="Billing2.Controls.CR.ucCRAttachment" %>
<%@ Import Namespace="Microsoft.Security.Application" %>
<%@ Register Src="~/Controls/ucHighlight.ascx" TagName="ucHighlight" TagPrefix="uc3" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<asp:Panel runat="Server" ID="ucAttachPart1">
    <asp:UpdatePanel runat="server" ID="updatePanel5">
        <ContentTemplate>
            <uc3:ucHighlight ID="ucHighlight1" runat="server" />
        </ContentTemplate>
    </asp:UpdatePanel>
    <table cellpadding="0" cellspacing="0">
        <tr>
            <td align="left">
                <asp:Panel runat="Server" ID="AttachmentPart1">
                    </asp:Panel>
            </td>
            <td align="left">
                <asp:Panel runat="Server" ID="AttachmentPart">
<%--                    <asp:FileUpload ID="FileUpload1" runat="server" Font-Names="Arial" Width="250px" CssClass="uploadFile"/>--%>
                        <asp:AsyncFileUpload ID="FileUpload1" runat="server" Font-Names="Arial" Font-Size="Small" Width="250px"
                                CssClass="uploadFile"/>
                    <asp:Button ID="BtnUpload" runat="server" Text="Attach File" OnClick="BtnUpload_Click" />
                </asp:Panel>
            </td>
        </tr>
        <tr>
            <td colspan="2">
                <asp:UpdatePanel ID="UpdatePanel3" runat="server">
                    <ContentTemplate>
                        <asp:GridView ID="gvAttachments" runat="server" CellPadding="0" CellSpacing="1"
                            GridLines="None" AutoGenerateColumns="False" DataKeyNames="AttachmentName" 
                            OnRowDeleting="grwAttachments_RowDeleting" 
                            onrowcommand="gvAttachments_RowCommand">
                            <Columns>
                                    <asp:TemplateField Visible="false">
                                        <ItemTemplate>
<%--                                            <asp:LinkButton ID="lblFileName" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("AttachmentName")))%>'
                                                OnClientClick='<%#Eval("ID","window.open(\"httpgetCRAttachment.aspx?AttachID={0}\",\"mywindow\",\"width=400,height=200\");return false;")%>'></asp:LinkButton>--%>
                                                <asp:LinkButton ID="lblFileName" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("AttachmentName")))%>'
                                                OnClientClick='<%#string.Format("window.open(\"httpgetCRAttachment.aspx?AttachID={0}\",\"mywindow\",\"width=400,height=200\");return false;", Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("ID"))))%>'></asp:LinkButton>
                                        </ItemTemplate>                                        
                                    </asp:TemplateField>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:Label ID="xCol05" runat="server" Text='<%#Microsoft.Security.Application.Encoder.HtmlEncode(Convert.ToString(Eval("AttachmentName")))%>'></asp:Label>
                                    </ItemTemplate>
                                    <HeaderStyle HorizontalAlign="Left" />
                                </asp:TemplateField>
                                <asp:TemplateField>
                                    <ItemTemplate>
                                        <asp:LinkButton runat="server" ID="linkRemove" CommandArgument='<%#Container.DataItemIndex%>' CommandName="RemoveAttach" Text="Remove" />
                                    </ItemTemplate>
                                    <HeaderStyle Width="80px" />
                                    <ItemStyle HorizontalAlign="Center" />
                                </asp:TemplateField>
                            </Columns>
                        </asp:GridView>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
    </table>
    <asp:HiddenField runat="server" ID="xTotalFileSize" Value="0" />
    <asp:HiddenField ID="xRoleID" runat="server" Value="0" />
</asp:Panel>

